#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
   whileRead.py
   autor wenzhui
'''
num = 25
while True:
    fname = raw_input('Enter a file name : ')
    with open(fname, 'r') as f:
        lines = f.readlines()
        if len(lines) <= 25:
            for line in lines:
                print line
        else:
            for i, line in enumerate(lines):
                if( i >= 25 ) : break
                print line
    raw_input('Enter any key to continue .. ')
    if fname == 'exit':
       break 
